﻿using UnityEngine;
using System.Collections;

public class WeaponController : MonoBehaviour {
	
	public GameObject leftWeapon;
	public GameObject rightWeapon;
	
	public GameObject shot;
	
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if(Input.GetMouseButtonDown(0))
		{
			GameObject newShot = Instantiate(shot, leftWeapon.transform.position + leftWeapon.transform.forward*8, leftWeapon.transform.rotation) as GameObject;
			newShot.rigidbody.AddForce(leftWeapon.transform.forward * 100000);
			
			GameObject newShot2 = Instantiate(shot, rightWeapon.transform.position + rightWeapon.transform.forward*8, rightWeapon.transform.rotation) as GameObject;
			newShot2.rigidbody.AddForce(rightWeapon.transform.forward * 100000);
			audio.Play();
		}
	}

}
